using System;

using MethodChaining.MFComputer.Builders;
using MethodChaining.MFComputer.Model;

using NUnit.Framework;







[TestFixture]
public class CreatingTheComputerWith2CoresSetting_CausesAnArgumentExceptionToBeThrown_When
{
	[Test]
	[ExpectedException( typeof( ArgumentException ) )]
	public void TwoDifferentWithCoresSettingsAreUsed()
	{
		new ComputerBuilder()
			.WithCores( 1 )
			.WithCores( 7 )
			;
	}





	[Test]
	[ExpectedException( typeof( ArgumentException ) )]
	public void IsDualCoreThenIsQuadCoreSettingsAreUsed()
	{
		Computer TheComputer = new ComputerBuilder()
			.IsQuadCore
			.IsDualCore
			;

		Assert.AreEqual( 0, TheComputer.NumberOfCores );
	}





	[Test]
	[ExpectedException( typeof( ArgumentException ) )]
	public void IsQuadCoreThenIsDualCoreSettingsAreUsed()
	{
		Computer TheComputer = new ComputerBuilder()
			.IsDualCore
			.IsQuadCore
			;

		Assert.AreEqual( 0, TheComputer.NumberOfCores );
	}





	[Test]
	public void ButNotIfMultipleIsDualCoreSettingsAreUsed()
	{
		Computer TheComputer = new ComputerBuilder()
			.IsDualCore
			.IsDualCore
			.IsDualCore
			;

		Assert.AreEqual( 2, TheComputer.NumberOfCores );
	}





	[Test]
	public void ButNotIfMultipleIsQuadCoreSettingsAreUsed()
	{
		Computer TheComputer = new ComputerBuilder()
			.IsQuadCore
			.IsQuadCore
			.IsQuadCore
			;

		Assert.AreEqual( 4, TheComputer.NumberOfCores );
	}
}